//
//  UIImage+function.h
//  zhuanxian
//
//  Created by qipai on 2017/11/20.
//  Copyright © 2017年 huiling. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (function)

//图片是否有alpha层
- (BOOL)hasAlpha;
//返回一个给定图像的副本，如果还没有一个alpha通道，就添加一个alpha通道。
- (UIImage *)imageWithAlpha;
//返回一个图像的拷贝，它的边缘有一个透明的边界。如果图像没有alpha层，就会添加一个图层。
- (UIImage *)transparentBorderImage:(NSUInteger)borderSize;

//给图片加圆角
- (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize;

//改变图片大小
- (UIImage *)croppedImage:(CGRect)bounds;
- (UIImage *)thumbnailImage:(NSInteger)thumbnailSize
          transparentBorder:(NSUInteger)borderSize
               cornerRadius:(NSUInteger)cornerRadius
       interpolationQuality:(CGInterpolationQuality)quality;
- (UIImage *)resizedImage:(CGSize)newSize
     interpolationQuality:(CGInterpolationQuality)quality;
- (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode
                                  bounds:(CGSize)bounds
                    interpolationQuality:(CGInterpolationQuality)quality;
- (UIImage *)cutoutImage:(CGRect)rect;

//图片转换
+ (UIImage *)animatedImageWithAnimatedGIFData:(NSData *)data;
+ (UIImage *)animatedImageWithAnimatedGIFURL:(NSURL *)url;
@end
